<template>

    <div>
        <div class="toolbar">
            <span>开机自启动</span>
            <el-switch v-model="value1" @change="setLoginSwithch" active-text="开" inactive-text="关" />
        </div>

    </div>
</template>

<script>

export default {
    data() {
        return {
            value1: true
        }
    },
    methods: {
        setLoginSwithch() {
            console.log(this.value1)

            const func = async () => {
            const response = await window.electron.ipcRenderer.invoke('enableWhenLogin', this.value1);
            console.log(JSON.stringify(response)) // prints out 'pong'
            }
            func()

            // let res = await window.electron.ipcRenderer.invoke('enableWhenLogin', this.value1);
            // console.log(JSON.stringify(res))

        }
    }
}
</script>